import Vue from 'vue'
import Router from 'vue-router'
// import home from '../components/home/home'
// import supervisor from '../components/supervisor/supervisor'
// import publish from '../components/publish/publish'
// import message from '../components/message/message'
// import my from '../components/my/my'
// import noticeList from '../components/notice/noticeList'
// import noticeDetail from '../components/notice/noticeDetail'
// import svote from '../components/vote/svote'
// import xvote from '../components/vote/xvote'
// import govern from '../components/govern/govern'
// import repaire from '../components/repaire/repaire'
// import rentSale from '../components/rentSale/rentSale'
// import seekHelp from '../components/seekHelp/seekHelp'
// import seekHelpDetail from '../components/seekHelp/seekHelpDetail'
// import unused from '../components/unused/unused'
// import unusedDetail from '../components/unused/unusedDetail'
// import kongPage from '../components/publish/kongPage'
// import weihuDetail from '../components/supervisor/weihuDetail'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      // component: home
      component: resolve => require.ensure([], () => resolve(require('../components/home/home')), 'demo1')
      // component: resolve => require(['../components/home/home'], resolve)
    },
    {
      path: '/supervisor',
      name: 'supervisor',
      // component: supervisor,
      component: resolve => require.ensure([], () => resolve(require('../components/supervisor/supervisor')), 'demo2'),
      // component: resolve => require(['../components/supervisor/supervisor'], resolve),
      meta: {
        keepAlive: true,
        isBack: false
      }
    },
    {
      path: '/publish',
      name: 'publish',
      // component: publish
      component: resolve => require.ensure([], () => resolve(require('../components/publish/publish')), 'demo3')
    },
    {
      path: '/message',
      name: 'message',
      // component: message
      component: resolve => require.ensure([], () => resolve(require('../components/message/message')), 'demo4')
    },
    {
      path: '/my',
      name: 'my',
      // component: my
      component: resolve => require.ensure([], () => resolve(require('../components/my/my')), 'demo7')
    },
    {
      path: '/noticeList',
      name: 'noticeList',
      // component: noticeList
      component: resolve => require.ensure([], () => resolve(require('../components/notice/noticeList')), 'demo8')
    },
    {
      path: '/noticeDetail/:id',
      name: 'noticeDetail',
      // component: noticeDetail
      component: resolve => require.ensure([], () => resolve(require('../components/notice/noticeDetail')), 'demo9')
    },
    {
      path: '/svote',
      name: 'svote',
      // component: svote
      component: resolve => require.ensure([], () => resolve(require('../components/vote/svote')), 'demo10')
    },
    {
      path: '/xvote',
      name: 'xvote',
      // component: xvote
      component: resolve => require.ensure([], () => resolve(require('../components/vote/xvote')), 'demo11')
    },
    {
      path: '/repaire',
      name: 'repaire',
      // component: repaire
      component: resolve => require.ensure([], () => resolve(require('../components/repaire/repaire')), 'demo12')
    },
    {
      path: '/govern',
      name: 'govern',
      // component: govern
      component: resolve => require.ensure([], () => resolve(require('../components/govern/govern')), 'demo13')
    },
    {
      path: '/rentSale',
      name: 'rentSale',
      // component: rentSale
      component: resolve => require.ensure([], () => resolve(require('../components/rentSale/rentSale')), 'demo14')
    },
    {
      path: '/seekHelp',
      name: 'seekHelp',
      // component: seekHelp
      component: resolve => require.ensure([], () => resolve(require('../components/seekHelp/seekHelp')), 'demo15')
    },
    {
      path: '/seekHelpDetail/:id',
      name: 'seekHelpDetail',
      // component: seekHelpDetail
      component: resolve => require.ensure([], () => resolve(require('../components/seekHelp/seekHelpDetail')), 'demo16')
    },
    {
      path: '/unused',
      name: 'unused',
      // component: unused
      component: resolve => require.ensure([], () => resolve(require('../components/unused/unused')), 'demo17')
    },
    {
      path: '/unusedDetail/:id',
      name: 'unusedDetail',
      // component: unusedDetail
      component: resolve => require.ensure([], () => resolve(require('../components/unused/unusedDetail')), 'demo18')
    },
    {
      path: '/kongPage',
      name: 'kongPage',
      // component: kongPage
      component: resolve => require.ensure([], () => resolve(require('../components/publish/kongPage')), 'demo19')
    },
    {
      path: '/weihuDetail/:id',
      name: 'weihuDetail',
      // component: weihuDetail
      component: resolve => require.ensure([], () => resolve(require('../components/supervisor/weihuDetail')), 'demo20')
    }
  ]
})
